//密码加密
import CryptoJS from 'crypto-js';

const keyword = 'shopkey-password';

export const encrypt = (word) =>{
	const time = new Date().getTime();
	//转码
	const wordStr = CryptoJS.enc.Utf8.parse(time+""+word);
	const key = CryptoJS.enc.Utf8.parse(keyword);
	//加密
	const CryptoStr=CryptoJS.AES.encrypt(wordStr,key,{
		mode:CryptoJS.mode.ECB,//加密模式
		padding:CryptoJS.pad.Pkcs7//如何补零
	})
	return CryptoStr.toString();
}